﻿using System.Globalization;
namespace Localization.Repository.Models
{
    public class ResourceCulture
    {
        //public ResourceCulture() { }
        //public ResourceCulture(CultureInfo culture)
        //{
        //    Name = culture.Name;
        //}
        //public ResourceCulture(int id, string name, bool isDefault)
        //{
        //    ResourceCultureID = id;
        //    Name = name;
        //    IsDefault = isDefault;
        //}

        public int ResourceCultureID { get; set; }
        /// <summary>
        /// Gets the name of the culture.
        /// </summary>
        /// <value>The name.</value>
        public virtual string Name { get; set; }
        /// <summary>
        /// Gets or sets a value indicating whether this instance is default resource culutre.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this instance is default; otherwise, <c>false</c>.
        /// </value>
        public virtual bool IsDefault { get; set; }

        public virtual CultureInfo GetCultureFromName()
        {
            return new CultureInfo(Name);
        }

        public override string ToString()
        {
            return GetCultureFromName().Name;
        }
    }
}
